import request from '@/utils/request'
import { checkResult } from '@/utils/utils'

/**
 * 获取安装链接
 * @param data
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function installLink(data: any) {
  return request({
    url: '/scrm-api/console/install/get-link',
    method: 'get',
    params: data
  })
}
/**
 * 获取应用二维码
 * @param data
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function getAppQrCode(data: any) {
  return request({
    url: '/weiwork/install/get-qrcode',
    method: 'get',
    params: data
  })
}
/**
 * 企业注册
 * @param data
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function corpRegister(data: any) {
  return request({
    url: '/weiwork/install/corp-register',
    method: 'get',
    params: data
  })
}

// 获取菜单
export function getMenuApi(data: Record<string, any>) {
  return request({
    url: 'scrm-api/console/login-api/login/user-function',
    method: 'post',
    data: data
  })
}
// 获取高级设置
export const getHeightSet = (data: any) => {
  return request({
    url: '/scrm-api/console/common/get-advanced-setup',
    method: 'GET',
    params: data
  })
}
// 设置高级配置
export const setHeight = (data: any) => {
  return request({
    url: '/scrm-api/console/common/advanced-setup',
    method: 'POST',
    data
  })
}
